from selenium import webdriver
from time import sleep

# 打开浏览器,请求目标网址
driver = webdriver.Chrome()
driver.get('https://mail.qq.com')

# 准备登录需要的cookie
cookies = [
    {
        'name': 'CCSHOW',
        'value': '000001'
    },
    {
        'name': 'sid',
        'value': '-1426700630&4890246dbc30a9ba977e6a51cb88c2fa,qaVBtNVpBVUVnOGJYdDBod3BQTUszb2VVSzIyV2pxZFVqTnI2VkVyZlpnMF8.'
    },
    {
        'name': 'username',
        'value': '-1426700630&2868266666'
    },
    {
        'name': 'qm_username',
        'value': '2868266666'
    },
    {
        'name': 'xm_data_ticket',
        'value': '13102663893141162&CAESIC2fMqjLmrKSapDwNc9a0_LmnMqi0Zo9GdcDZXAKQxwo'
    },
    {
        'name': 'qm_domain',
        'value': 'https://mail.qq.com'
    },
    {
        'name': 'p_skey',
        'value': 'iPm5ZAUEg8bXt0hwpPMK3oeUK22WjqdUjNr6VErfZg0_'
    }
]


# 添加cookie
for i in cookies:
    driver.add_cookie(i)

# 刷新浏览器
driver.refresh()

# 退出浏览器
sleep(5)
driver.quit()
